package com.rfid.project.service;

import java.util.ArrayList;
import java.util.List;

import biz.core.KeyValue;

public class ProcessType {
	//项目完结流程
	public static final String PROJECT_FINISH = "0100";
	//项目延期流程
	public static final String PROJECT_DELAY = "0200";
	//项目节点质量控制流程
	public static final String PROJECT_MILESTONE_QUALITY = "0300";
	//项目节点完结流程
	public static final String PROJECT_MILESTONE_FINISH = "0400";
	//项目节点延期流程
	public static final String PROJECT_MILESTONE_DELAY = "0500";
	//项目任务完结流程
	public static final String PROJECT_TASK_FINISH = "0600";
	//项目任务延期流程
	public static final String PROJECT_TASK_DELAY = "0700";
	//项目交付记录审核流程
	public static final String PROJECT_DELIVERY_CHECK = "0800";
	
	public static String getProcessTypeName(String processTypeCode){
		String processTypeName = "[未知]";
		if(PROJECT_FINISH.equals(processTypeCode)){
			processTypeName = "项目完结";
		}else if(PROJECT_DELAY.equals(processTypeCode)){
			processTypeName = "项目延期";
		}else if(PROJECT_MILESTONE_QUALITY.equals(processTypeCode)){
			processTypeName = "项目节点质量控制";
		}else if(PROJECT_MILESTONE_FINISH.equals(processTypeCode)){
			processTypeName = "项目节点完结";
		}else if(PROJECT_MILESTONE_DELAY.equals(processTypeCode)){
			processTypeName = "项目节点延期";
		}else if(PROJECT_TASK_FINISH.equals(processTypeCode)){
			processTypeName = "任务完结";
		}else if(PROJECT_TASK_DELAY.equals(processTypeCode)){
			processTypeName = "任务延期";
		}else if(PROJECT_DELIVERY_CHECK.equals(processTypeCode)){
			processTypeName = "交付记录确认";
		}
		return processTypeName;
	}

	public static List<KeyValue> getTypeList() {
		List<KeyValue> resultList = new ArrayList<KeyValue>();
		resultList.add(new KeyValue(PROJECT_FINISH, getProcessTypeName(PROJECT_FINISH)));
		resultList.add(new KeyValue(PROJECT_DELAY, getProcessTypeName(PROJECT_DELAY)));
		resultList.add(new KeyValue(PROJECT_MILESTONE_QUALITY, getProcessTypeName(PROJECT_MILESTONE_QUALITY)));
		resultList.add(new KeyValue(PROJECT_MILESTONE_FINISH, getProcessTypeName(PROJECT_MILESTONE_FINISH)));
		resultList.add(new KeyValue(PROJECT_MILESTONE_DELAY, getProcessTypeName(PROJECT_MILESTONE_DELAY)));
		resultList.add(new KeyValue(PROJECT_TASK_FINISH, getProcessTypeName(PROJECT_TASK_FINISH)));
		resultList.add(new KeyValue(PROJECT_TASK_DELAY, getProcessTypeName(PROJECT_TASK_DELAY)));
		resultList.add(new KeyValue(PROJECT_DELIVERY_CHECK, getProcessTypeName(PROJECT_DELIVERY_CHECK)));
		return resultList;
	}
}
